<%@ page language="java" import="control.database.*" pageEncoding="gbk"%>

<%
/**Dpt dpt = new Dpt();

System.out.println("1111111");

dpt.setDptid(request.getParameter("txtDptno").toString());
System.out.println("2222");
dpt.setDptname(request.getParameter("sBranName").toString());
dpt.setDptlevel("1".toString());
dpt.setBranchid(request.getParameter("txtBranchid").toString());
System.out.println("222");
dpt.setDptaddress(request.getParameter("txtDptaddress").toString());
dpt.setDptmanager(request.getParameter("txtDptmanager").toString());
System.out.println("1111111");
dpt.setDptcontact(request.getParameter("txtDptcontact").toString());
dpt.setTxtWReptMan(request.getParameter("txtWReptMan").toString());
System.out.println("222");

dpt.Dpt_Add();*/
request.setCharacterEncoding("gbk");
String dptid=request.getParameter("txtDptno").toString();
String dptname=request.getParameter("sBranName").toString();
String dptlevel="1";
String branchid=request.getParameter("txtBranchid").toString();
String dptaddress=request.getParameter("txtDptaddress").toString();
String dptmanager=request.getParameter("txtDptmanager").toString();
String dptcontact=request.getParameter("txtDptcontact").toString();
String TxtWReptMan=request.getParameter("txtWReptMan").toString();
String sql="insert into tdpt(sdptid,sBranName,sdptlevel,sbranchid,sdptaddress,sdptmanager,sdptcontact,WReptMan) values('" + dptid + "','" + dptname + "','" + dptlevel + "','" + branchid + "','" + dptaddress + "','" + dptmanager + "','" + dptcontact + "','" + TxtWReptMan + "')";

DataBase db= new DataBase();
db.executeUpdate(sql);
db.closeStmt();
db.closeConn();

response.sendRedirect("AddSuccessful.jsp");
%>

